#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>

typedef int HPDataType;
typedef struct Heap
{
	HPDataType* a;
	int size;
	int capacity;
}HP;	
void AdjustDown(HPDataType* a, int n, int parent);
void AdjustHeapUp(HPDataType* a, int child);
void Swap(int* a, int* b);

void HeapPrint(HP* php);
void HeapInit(HP* php);
void HeapInitArr(HP* php, int * a, int n);
void HeapDestry(HP* php);
void HeapPush(HP* php, HPDataType x);
void HeapPop(HP* php);
HPDataType HeapTop(HP* php);
bool HeapEmpty(HP* php);